//
//  XYProcessCell.m
//  XYRTCEngineSimpleDemo
//
//  Created by 高超 on 2021/12/2.
//

#import "XYProcessCell.h"

@implementation XYProcessCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.inputTF.textColor = XYColor(@"#393946", 1);
    self.cellType = 0;
}

- (void)setCellType:(NSInteger)cellType {
    _cellType = cellType;
    if (cellType) {
        self.titleLabel.hidden = YES;
        self.inputTF.hidden = YES;
        self.button.hidden = NO;
    } else {
        self.titleLabel.hidden = NO;
        self.inputTF.hidden = NO;
        self.button.hidden = YES;
    }
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.button.backgroundColor = XYColor(@"#3876FF", 1);
    self.button.layer.cornerRadius = 4.f;
    [self.button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.button.titleLabel.font = [UIFont systemFontOfSize:16];
}

- (IBAction)buttonClick:(id)sender {
    if (self.action) {
        self.action();
    }
}

@end
